{% extends "shared/layout.volt" %}
{% block content %}
    <h1 class="page-header">
        角色列表
        {% if Member.isPermission('Role','edit') %}
            <a href="{{ url("role/edit") }}" class="btn btn-default btn-sm pull-right"><i class="fa fa-plus"></i> 新增角色</a>
        {% endif %}
    </h1>
    <div class="table-responsive">
        <table class="table-tidy">
            <thead class="table-tidy-head">
            <tr>
                <th style="width: 80px;">#</th>
                <th>角色名称</th>
                <th style="width: 180px;">角色状态</th>
                <th style="width: 210px;">创建时间</th>
                <th style="width: 120px;">导航显示</th>
                <th style="width: 80px;">操作</th>
            </tr>
            </thead>
            <tbody class="table-tidy-body">
            {% for item in Model.items %}
                <tr>
                    <td>{{ item.role_id }}</td>
                    <td>{{ item.role_name }}</td>
                    <td>{{ item.role_name }}</td>
                    <td>{{ item.role_state == 1?'是':'否' }}</td>
                    <td>{{ item.create_time }}</td>
                    <td>
                        {% if item.icon_class is not empty %}
                            <i class="{{ item.icon_class }}"></i>
                        {% else %}
                            无
                        {% endif %}
                    </td>
                    <td>
                        <a href="{{ url('role/edit') }}?resource_id={{ item.role_id }}">编辑</a>
                    </td>
                </tr>
            {% else %}
                <tr>
                    <td class="text-center" colspan="8">暂无数据</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        <div class="page pagination">
            <?php echo $Model->getPaginate();?>
        </div>
    </div>
{% endblock %}